<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.utils.ConfigManager" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/shippingLocationforSOAction.do"/>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>
<%@ page import="com.scalar.chiptrack.commons.Constants" %>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<%
    String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + "";
    String userTypeCustomer = Constants.USER_TYPE_CUSTOMER + "";
    String userTypeSalesPerson = Constants.USER_TYPE_SALES_PERSON + "";
%>
<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>
</HEAD>
<script language="javascript">

    var dateElement = "";
    function openCalendar(dateValue)
    {
        dateElement = dateValue;
        newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
        newWindow.moveTo(550,180);
        newWindow.focus();
    }

    function assignDate(passedValue)
    {
        dateElement.value=passedValue;
        window.focus();
    }
    function submitPage()
    {
        var form = document.shippingLocationforSOForm;
        form.action = "<%=chipTracContext%>/shippingLocationforSOAction.do?action=save";
        form.submit();
    }
</script>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" >
<!-- Top Header Start-->

    <%--<logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">--%>
        <%@ include file="/jsp/includes/header.jsp" %>
    <%--</logic:equal>--%>
    <%--<logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/extHeader.jsp" %>
    </logic:notEqual>--%>

<!-- Top Header End-->
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
    <!-- Side Navigation start -->
    <%@ include file="/jsp/sales/sales_menu.jsp" %>
        <%--<logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/sales_report_menu.jsp" %>
        </logic:equal>
        <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/external_reports_menu.jsp" %>
        </logic:notEqual>--%>
    <!-- end of the side navigations -->
    </TD>
    <TD bgcolor="#ffffff">
        <IMG height="9" src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="8"></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="2"></TD>
        <TD valign="top" width="100%">
        <IMG height="1" src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width="500" border="0">
        <BR>
        <html:form name="shippingLocationforSOForm" type="com.scalar.chiptrack.sales.forms.ShippingLocationforSOForm" action="/shippingLocationforSOAction">
        <TABLE border="0" width="100%" align="center">
            <TR><TD colspan="7" class="NArialW" align="center">Select SO Shipping Location</TD></TR>
            <TR><TD colspan="7">&nbsp;</TD></TR>
            <TR>
                <TD>&nbsp;</TD>
                <TD colspan="7" align="left">
                  <chiptrack:info styleClass="NArialL" />
                  <chiptrack:errors styleClass="NArialL" />
                </TD>
            </TR>
            <TR>
                <TD colspan="7">
                    <TABLE align="center" border="0" width="100%" cellspacing="1" cellpadding="0">
                        <tr>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Sales Order #</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Line Item #</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Customer PO #</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Customer Name</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Req. Date</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Latest Sch. Date</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Part Number/Qty</font></td>
	                        <td width="8%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Shipping Location</font></td>
                        </tr>
                        <nested:size id="size" property="salesOrderList"/>
                        <nested:iterate property="salesOrderList" id="soShippingLocation" indexId="idx">
                            <tr>
                                <nested:hidden property="salesOrderId"/>
                                <nested:hidden property="lineItemId"/>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL"><nested:write property="salesOrderNo"/></td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL"><nested:write property="lineItemNo"/></td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL"><nested:write property="customerPONo"/></td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL"><nested:write property="customerName"/></td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL"><nested:write property="requestedDate"/></td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL"><nested:write property="scheduleDate"/></td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL">
                                <nested:iterate property="partNumberList" id="partNumberQty">
                                    <bean:write name="partNumberQty"/><br>
                                </nested:iterate>
                                </td>
                                <td width="8%" align="center" bgcolor="<%=idx.intValue()%2==0?"#FFFFEE":"#DEE1E2"%>" class="NArialL">
                                    <nested:select property="shippingLocationId" multiple="true" size="6" styleClass="txfield">
                                        <html:options collection="locationList" property="locationID" labelProperty="locationName"/>
                                    </nested:select>
                                </td>
                            </tr>
                        </nested:iterate>
                        <logic:equal value="0" name="size">
                            <tr>
                                <td colspan="7" class="NArialL">No Sales Order(s) found for the given search criteria.</td>
                            </tr>
                        </logic:equal>
                        <TR><TD colspan="7"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD></TR>
                        <logic:greaterThan value="0" name="size">
                        <TR>
                            <TD colspan="7" align=center>
                                <a href="javascript:submitPage();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17" onmouseover="window.status='Click to save Shipping Locations for Sales Order';return true" onmouseout="window.status='';return true" title='Click to save Shipping Locations for Sales Order'></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a href="javascript:document.shippingLocationforSOForm.reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to reset';return true" onmouseout="window.status='';return true" title="Click here to reset"></a>
                            </TD>
                        </TR>
                        </logic:greaterThan>
                        <TR><TD colspan="7"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD></TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        </html:form>
    </TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>